
<?php
session_start();
require_once '../models/Product.php';
$mgs="";
$brandID= $_REQUEST['brandID'];
$rows	= Product::getBrandInfo($brandID);

?>
<!DOCTYPE html>
<html>
<head>
<title>Update Brand</title>
<?php include '../admin/_meta.php';

?>
<script type="text/javascript" src="../js/jquery.7.1.min.js"></script>
	<script type="text/javascript" src="../js/jquery.form.js"></script>
	<script type="text/javascript" src="../js/script.js"></script>
</head>
<body>
	<div id="firstLine">
		<div id="top-bar">
		<?php include '_top_bar_admin.php';?>
		</div>
	</div>
	<div id="container">
		<div id="header">
			<?php include '_menu_admin.php';?>
		</div>
		<div id="center">
			<div id="table-user">
				<table id="table-admin">
					<tr>
						<td colspan="2"><b>Update Brand</b></td>
					</tr>
					<tr>
						<td>Brand ID</td>
						<td><input type="text" name="brandID" id="brandID" value="<?php echo $rows["brandID"];?>" disabled="disabled"></td>
					</tr>
					<tr>
						<td>Name</td>
						<td><input type="text" name="brandName" id="brandName" value="<?php echo $rows["brandName"];?>" /></td>
					</tr>
					<tr>
						<!-- loader.gif -->
						<img style="display:none" id="loader" src="../images/loader.gif" alt="Loading...." title="Loading...." />
						<td>Image:</td>
						<td><div class="wrap">
						<!-- simple file uploading form -->
						<form id="form" action="../models/ajaxupload-brand.php" method="post" enctype="multipart/form-data">
							<input id="uploadImage" type="file" accept="image/*" name="image" />
							<input id="button" type="submit" value="Upload">
						</form>
						<!-- preview action or error msgs -->
						<div id="preview">
						<div class="img_small_icon"><img name='uploadImage2' id='image' src='<?php echo $rows['br_image']?>'/></div>
							<input type='hidden' name='uploadImage2' id='uploadImage2' value='<?php echo $rows['br_image']?>' />
						</div>
						</div><!--wrap--></td>
					</tr>
					<tr>
						<td>Status:</td>
						<td><select name="br_status" id="br_status">
						<?php if($rows['br_status']=="active"){
						echo "<option value='active'>Active</option>";
						echo "<option value='block'>Block</option>";
						}else{
						echo 	"<option value='block'>Block</option>";
						echo	"<option value='active'>Active</option>";
						}
						?>
						</select>
						</td>
					</tr>
					<tr>
						<td><input type="button" name="btn_submit" value="Update" class="btn_submit" onclick="upBrand();"></td>
						<td><a href="ql_brand.php"><input type="button" name="button" value="Quay lại" class="btn_submit"></a></td>
					</tr>
					<tr>
						<td colspan="2"><?php if(isset($_POST['btn_submit'])) echo $mgs; ?></td>
					</tr>
					<?php //Product::listBrand();?>
				</table>
					<div class="clear-both"></div>
					<div class="view-content">
						<div class="loading-container">
							<span class="loading-image" id="submit-loading"></span>
						</div>
						<div class="ajax-content" id="brand-div">
							<?php //Product::printBrandTable('');?>
						</div><br/>				
					</div>
			</div>
							
		</div>
	</div>
	<div>
		<?php include '_footer_admin.php';?>
	</div>
</body>
</html>
				
				
